# Maintainer: justforlxz <justforlxz@gmail.com>
pkgname=dtkcore-git
pkgver=5.7.26
pkgrel=1
sourcename=dtkcore
sourcetars=("$sourcename"_"$pkgver".tar.xz)
sourcedir="$sourcename"
pkgdesc='DTK core modules'
arch=('x86_64' 'aarch64')
url="https://github.com/linuxdeepin/dtkcore"
license=('LGPL3')
depends=('deepin-desktop-base-git' 'gsettings-qt' 'dtkcommon-git' 'lshw' 'uchardet' 'icu' 'libsystemd' 'spdlog')
makedepends=('git' 'qt5-tools' 'ninja' 'cmake' 'doxygen')
conflicts=('dtkcore')
provides=('dtkcore')
groups=('deepin-git')
source=("${sourcetars[@]}")
sha512sums=('SKIP')

build() {
  cd $sourcedir
  cmake \
    -GNinja \
    -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
    -DBUILD_DOCS=ON \
    -DBUILD_WITH_SYSTEMD=ON \
    -DBUILD_EXAMPLES=OFF \
    -DQCH_INSTALL_DESTINATION=share/doc/qt \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata \
    -DBUILD_WITH_SYSTEMD=ON
  ninja
}

package() {
  cd $sourcedir
  DESTDIR="$pkgdir" ninja install
}
